package com.skcc.cip.ngms.auth.processor;

import javax.naming.InitialContext;

import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;

import com.skcc.cip.ngms.dto.response.jaxb.auth.CommonAuthResponse;
import com.skcc.cip.ngms.dto.response.jaxb.auth.MetaInfo;

public class AuthunticationResponse implements Processor{
	
	public void process(Exchange exchange) throws Exception {
		
		// TODO 임시 로그인 성공 응답 메세지
		CommonAuthResponse response = new CommonAuthResponse();
		MetaInfo info = new MetaInfo();
		info.setPrimitive("COMMON_AUTH");
		info.setResult("1000");
		info.setResultMessage("Login Success");
		response.setMetaInfo(info);
		
		CamelContext camelContext = exchange.getContext();
		exchange.getIn().setBody(response);
		camelContext.createProducerTemplate().send("direct:end", exchange);
		exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);
		
	}

}
